package com.huike.login.controller;

import com.huike.login.service.LoginService;
import com.huike.vo.LoginVO;
import com.sky.result.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.Map;

@RestController
@Slf4j
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("/login")
    public Result<String> login(@RequestBody LoginVO vo) {
        System.out.println(vo);
        return loginService.login(vo);

    }

    @GetMapping("/getInfo")
    public String getInfo() {
        return "ok";
    }

    @GetMapping("/captchaImage")
    public Map<String,Object> captchaImage() {
     return   loginService.getVerificationCode();
    }
}
